﻿package mortal.game.control
{
    import extend.language.*;
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.mvc.*;
    import mortal.game.proxy.*;
    import mortal.game.view.complain.*;
    import mortal.mvc.core.*;
    import mortal.mvc.interfaces.*;

    public class ComplainController extends Controller
    {
        private var _complainProxy:ComplainProxy;
        private var _complainModule:ComplainModule;

        public function ComplainController()
        {
            this.init();
            return;
        }// end function

        private function init() : void
        {
            this._complainProxy = GameProxy.complain;
            return;
        }// end function

        override protected function initServer() : void
        {
            Dispatcher.addEventListener(EventName.ComplainSumbit, this.onSumbitContent);
            return;
        }// end function

        override protected function initView() : IView
        {
            if (this._complainModule == null)
            {
                this._complainModule = new ComplainModule();
            }
            return this._complainModule;
        }// end function

        private function onSumbitContent(event:DataEvent) : void
        {
            var _loc_2:* = event.data as Array;
            this._complainProxy.sendGmReport(int(_loc_2[0]), String(_loc_2[1]), String(_loc_2[2]));
            MsgManager.showRollTipsMsg(Language.getString(20386));
            if (this._complainModule && !this._complainModule.isHide)
            {
                this._complainModule.hide();
            }
            return;
        }// end function

    }
}
